UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WTmCvCvkXNhuUVwGYs9or4JignB5ekVE6Ayd2x1Ayxo=' 
WHERE 
  key_id = '22deb24287cf713377a757af20fe356c7f27708d2f645fa9e88dc14d7a9b7217' 
  AND (
    token = 'WTmCvCvkXNhuUVwGYs9or4JignB5ekVE6Ayd2x1Ayxo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033