UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5j4nrEb/TGyVHCRDwdLh4j3dUWOzL3Sw0b6zGkR+lC8=' 
WHERE 
  key_id = '3fbaae616b524d6e91737ca60d0d44e1f8cf0899e6d459a6782856094e9f4bc6' 
  AND (
    token = '5j4nrEb/TGyVHCRDwdLh4j3dUWOzL3Sw0b6zGkR+lC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035