UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5vWZEQzD1GigrPVRH4O7JpDaxHkruVDBpjhiK/vVmOM=' 
WHERE 
  key_id = 'db6377e4e2e109af4ae335331c33eea8069c8297fd0113fe52c480b1e381826d' 
  AND (
    token = '5vWZEQzD1GigrPVRH4O7JpDaxHkruVDBpjhiK/vVmOM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020