UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yvBiZVlXEYRhZEgtsQNHMMCUUcJnSrkSJY3Hyw/FEU0=' 
WHERE 
  key_id = 'e997147e65212aa4e08d6d39e18e4f8dc7b1a580dfcfa50fd3a67ad8fd5d6dd1' 
  AND (
    token = 'yvBiZVlXEYRhZEgtsQNHMMCUUcJnSrkSJY3Hyw/FEU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060