UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XsuzJgyL28VGKM9h78fNQ4jeMYA+cQKbgm16gOZhxds=' 
WHERE 
  key_id = 'fd05f573e157ba87dd3fa07543851f7948ca19b96bb182772b41fc25e4d013ac' 
  AND (
    token = 'XsuzJgyL28VGKM9h78fNQ4jeMYA+cQKbgm16gOZhxds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025