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

Query time 0.00030