UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sw+AfJkxaBCpPu/a7sXsZz3HKHR0kzhaKhMPKFDonLE=' 
WHERE 
  key_id = '159e78751ed7c411cbc2b15f598f6dc16b0d304ed4efeafb466612b2c4663c8c' 
  AND (
    token = 'sw+AfJkxaBCpPu/a7sXsZz3HKHR0kzhaKhMPKFDonLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016