UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mdrv5rQT6CQ6XRr+rlm1ybvQ3ytP98h770eoCCtM8+0=' 
WHERE 
  key_id = '4a8b20a9543dfb6739b16574f01b56fbf0fa05acb7ac8671d3a51f5059f48ba3' 
  AND (
    token = 'Mdrv5rQT6CQ6XRr+rlm1ybvQ3ytP98h770eoCCtM8+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038