UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x5BUZw8mi/OulnEBMRZ7OR7c14DAttyWkU3XVANY01Q=' 
WHERE 
  key_id = '27785cfcfc5e7ac4f249a9f03f888aa972d4e9db0fb7fdfa113a963da0a26f9c' 
  AND (
    token = 'x5BUZw8mi/OulnEBMRZ7OR7c14DAttyWkU3XVANY01Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049