UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '754JtiWxLG3HhN/btYpIfVEeDwery8IpMplMqeUrEA8=' 
WHERE 
  key_id = '8210339dff7982492464051db701e577aeeed99cb6850c01780ec6c667c01c21' 
  AND (
    token = '754JtiWxLG3HhN/btYpIfVEeDwery8IpMplMqeUrEA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014