UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LslBNuQMyWzN119gotcc57FXS8ZlDzBpKJ6roF50f5w=' 
WHERE 
  key_id = '9cc0c19770aa0fc4d8cff5202e129b4de81f993bf7163127c45021a5a4399c75' 
  AND (
    token = 'LslBNuQMyWzN119gotcc57FXS8ZlDzBpKJ6roF50f5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050