UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j0V1DhMb4Nz3mS/yb5oCUDd76iWnkpxKPmGNvGvyGjM=' 
WHERE 
  key_id = '4dcf2e4dc00d1f2bf6ec515679c7284ffcda2b72c6cc7b71021f0ee449f60743' 
  AND (
    token = 'j0V1DhMb4Nz3mS/yb5oCUDd76iWnkpxKPmGNvGvyGjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055