UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ezkPRecldNPtt4nxvDIPMqDdlV+MIJUV0Fb/1yJhuw0=' 
WHERE 
  key_id = '65f9c8e9b3133309e655fe329b608846b3edaf4260b70e3d28c7f68261b14758' 
  AND (
    token = 'ezkPRecldNPtt4nxvDIPMqDdlV+MIJUV0Fb/1yJhuw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029