UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tay8pNtMQT8zKAiLA9zHNL6Qal+WiWpOHkSWUYfFivM=' 
WHERE 
  key_id = '7700f022e5b2e662e3467d2bdd80c699f4568c9ae4b9db6300d9aaa0d3fae342' 
  AND (
    token = 'Tay8pNtMQT8zKAiLA9zHNL6Qal+WiWpOHkSWUYfFivM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031