UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oi3jeDaV7V/fLepgpKKvc1jTO9peo1Mn+ef5bqkf1V4=' 
WHERE 
  key_id = 'c12d185d797c7962adb8b1a3f0ff91ec6e6c8f84aa6cf0863aba0512ecafe10a' 
  AND (
    token = 'Oi3jeDaV7V/fLepgpKKvc1jTO9peo1Mn+ef5bqkf1V4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035