UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CGo40G9z/guLz2GU7iQcdNdG1/Pbp2LmTHZ7AfhqSf8=' 
WHERE 
  key_id = '53f81d71d0af02773fc709a72f631d0cfa0e7df4c17fcb8eea77ab600708a9fd' 
  AND (
    token = 'CGo40G9z/guLz2GU7iQcdNdG1/Pbp2LmTHZ7AfhqSf8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046