UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8twfGNexIJF7eXAj4McEuW5WH1abk7sBDPH/+nLNG6w=' 
WHERE 
  key_id = '3c674ebe5bd9d756cba7abdbfe17d1c03bedbb70047df2e69acebcf8dbcab752' 
  AND (
    token = '8twfGNexIJF7eXAj4McEuW5WH1abk7sBDPH/+nLNG6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016