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

Query time 0.00033