UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sADMKZ7H1tNf3PU4B84qXAOcMP3FM8lgtbLz4HRdJpw=' 
WHERE 
  key_id = 'c21be60a21adc632b07fc8fb1946c21ed6ff229c432eabf55e66078fcefb4789' 
  AND (
    token = 'sADMKZ7H1tNf3PU4B84qXAOcMP3FM8lgtbLz4HRdJpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051