UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ejjo6YYllZeyb59c7wZbVXWTsinUn5PSSMgZvzB3VaM=' 
WHERE 
  key_id = 'e21941fc35e5051aae3b05b9632c5d6a96f9a5eaadada239425c0b14fa3269ec' 
  AND (
    token = 'Ejjo6YYllZeyb59c7wZbVXWTsinUn5PSSMgZvzB3VaM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034