UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1mbAdBMiVVA5usunbBvClgfctIzjvsYCOmCoRFz9eEo=' 
WHERE 
  key_id = 'f4d47b7797a93fe68c49d0ac26a1825e1d49cd4eedd14a1a90ff4fddaebaf703' 
  AND (
    token = '1mbAdBMiVVA5usunbBvClgfctIzjvsYCOmCoRFz9eEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027