UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TZIEW/gueckXUGGF3b34NBqC8RBIJ2Lg8PZH+Pj8S2s=' 
WHERE 
  key_id = '4223283321debbf1a78f459e94a24325802827a156b506ff62efc779f54e32cc' 
  AND (
    token = 'TZIEW/gueckXUGGF3b34NBqC8RBIJ2Lg8PZH+Pj8S2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020