UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7cfjDnKfs6vA0zFHQ42XOkRKm69v3DA60TxoC9iwXOY=' 
WHERE 
  key_id = '35715db08c491cabb37ad384cacb516c34d8313068335c5387c629fd12d65f42' 
  AND (
    token = '7cfjDnKfs6vA0zFHQ42XOkRKm69v3DA60TxoC9iwXOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024