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

Query time 0.00031