UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q6UE+odcoXtD8V2TiPJDHQG4h95hO4qJeE77PrXmcwQ=' 
WHERE 
  key_id = '06ccff232444fc9e55e3bc751ab5d86a2abac1b71d06a53bc1d72f92347a0ae0' 
  AND (
    token = 'Q6UE+odcoXtD8V2TiPJDHQG4h95hO4qJeE77PrXmcwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032