UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7UJcBM6k6w0dI4VvrWWHhcFAZpynmMYp6XP4kUomNaQ=' 
WHERE 
  key_id = 'f2f6e4746fd24b3e86962505156b6a547b33269a0ebbb77994ca36c3a6034a5c' 
  AND (
    token = '7UJcBM6k6w0dI4VvrWWHhcFAZpynmMYp6XP4kUomNaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023