UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tK7h9nEsCh0CdscrmKPw0yKbLABI+1onOGrfQ31/5No=' 
WHERE 
  key_id = 'b6cdca08924bd81991138c0476b43721af13c17940fb056fc377be96336574cd' 
  AND (
    token = 'tK7h9nEsCh0CdscrmKPw0yKbLABI+1onOGrfQ31/5No=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043