UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5kcRf34+SNO9qoKKsqurHC0qzir1C5/2nGfVkf+zDKo=' 
WHERE 
  key_id = '824d61c64821c9d903af819b2c271de23e9bcd98974d290f6cec2f1741e9ae01' 
  AND (
    token = '5kcRf34+SNO9qoKKsqurHC0qzir1C5/2nGfVkf+zDKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037