UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kb+edWKuLPjdBmPPq+GUzgENGUchQjfPEZAiIzcguRU=' 
WHERE 
  key_id = '241dc22032687073c253a73b2ff8322a8340c6ea17de2695848df6fb44414b7a' 
  AND (
    token = 'kb+edWKuLPjdBmPPq+GUzgENGUchQjfPEZAiIzcguRU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016