UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OjhIbOXE9LtBLps/8hAK+g4NutK9ccHm8K79k+vBAlw=' 
WHERE 
  key_id = '89ed0dc2cc85b04c3d943bf5ff54a1587c81cfb2f029ba8b64af8c9a03c3c830' 
  AND (
    token = 'OjhIbOXE9LtBLps/8hAK+g4NutK9ccHm8K79k+vBAlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036