UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/LyEZLIz5jVfLnlOS6ALoOilFRnpNDSnoBDHEDByX6o=' 
WHERE 
  key_id = '16b3b13a85bb45b500381ef88f0710e0816b837e48c999831caacb01a89929ff' 
  AND (
    token = '/LyEZLIz5jVfLnlOS6ALoOilFRnpNDSnoBDHEDByX6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029